<template>
    <div class="hdljiedian">
        <div id="bjt">
        <div class="hdlwrap">
            <el-form  status-icon  ref="ruleForm2" label-width="100px" class="demo-ruleForm">
                <el-form-item label="账号" prop="age">
                    <el-input id="uname"></el-input>
                </el-form-item>
                <el-form-item label="密码" prop="pass">
                    <el-input type="password" id="pwd" autocomplete="off"></el-input>
                </el-form-item>
                <el-form-item label="确认密码" prop="checkPass">
                    <el-input type="password"  autocomplete="off" id="newpwd"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="submitForm">提交</el-button>
                    <el-button>重置</el-button>
                </el-form-item>
            </el-form>
        </div>
        </div>
    </div>
</template>
<script>
export default {
	data(){
        return{
          uname:'',
          pwd:'',
          newpwd:''
        }
    },
    methods:{
      // resetForm(ruleForm2){

      // },
		submitForm(){
			var uname=document.getElementById('uname').value
      var pwd=document.getElementById('pwd').value
      var newpwd=document.getElementById('newpwd').value
			this.uname=uname
      this.pwd=pwd
      this.newpwd=newpwd
			if(this.uname==''||this.pwd==''||this.newpwd==""){
				this.$toast({
					message:'请完善登录信息',
					duration:2000
				})
				return false
			}
			axios.post('/api/htlogin',{uname:this.uname,pwd:this.pwd,newpwd:this.newpwd}).then((data)=>{
				if(data.data.num){
					this.$toast({
                        message:"登录成功",
                        duration:1500
                    })
					this.$router.push('/houtai')
				}else{
					this.$toast({
                        message:"用户名或密码错误",
                        duration:1500
                    })
                    return false
				}
			})
		}
    }
}
</script>

<style>
.hdljiedian{
    margin-top:100px;
    width: 100%;
    height: 600px;
    background: #000;
}
#bjt{
    width: 1200px;
    margin: 100px auto 0;
    height: 600px;
    background: url('../assets/img/ys/bjht.png')
}
    .hdlwrap{
        position: absolute;
        top:300px;
        right:500px;
    }
</style>


